using UnityEngine;

namespace Gj
{
    public class SkinHelper : NodeHelper
    {
        public GameObject skin;

        protected override BindDataType bindDataType => BindDataType.String;

        protected override void BindData(string s)
        {
            if (skin != null)
            {
                if (skin.name == s)
                    return;
                ObjectService.single.DestroyObj(skin);
            }
            else
            {
                skin = ObjectService.single.MakeSkin(s, gameObject);
            }
        }
    }
}